package ca.etsmtl.gti785.util;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;

/**
 * This class is used for transfering files infos between client sides and server sides (between teams in the meta-team).
 * @author Timothé Fillion-Brunet
 */
public class Fichier implements Serializable 
{
	private static final long serialVersionUID = -2625971140021857612L;
	
	public final boolean isFolder;
	public final String name;
	public final String path;
	public List<Fichier> listFichiers = null;
	
	public Fichier(boolean isFolder, String name, String path)
	{
		this.isFolder = isFolder;
		this.name = name;
		this.path = path;
		
		if(isFolder)
			this.listFichiers = new ArrayList<Fichier>();
	}
	
	public String toJSON()
	{
		Gson gson = new Gson();
		return gson.toJson(this);
	}
}
